Skip to main content

Get Local Seller Metrics

Method: GET
/api/v1/local-sellers/metrics


Description

This endpoint retrieves metrics for local sellers (e.g., farmers or merchants) based on the specified filters. It allows grouping and filtering by various criteria, such as date range, seller type, and user details.


🔑 Authentication

This endpoint requires authentication via headers.

ParamValueType
tenantId{{tenantId}}string
userId{{userId}}string
countryCode{{countryCode}}string (optional)

Query Parameters

NameTypeDescription
localSellerSearchstringSearch for sellers by name or keyword.
groupBystringGroup metrics by specific fields (comma-separated). Available values: CREATED_BY, UPDATED_BY.
metricDateRangestringFilter metrics by date range (e.g., 2020-11-12,2022-11-15).
byValueTypestringTime-based grouping (e.g., HOUR, DAY, MONTH).
byValuenumberA numeric value to filter based on byValueType.
localSellerDateRangestringFilter sellers by date range (e.g., 2020-11-12,2022-11-15).
localSellerByTypesstringFilter by seller type (FARMER, MINER).
localSellerByPhonestringSearch sellers by phone number.
localSellerByLastNamestringSearch sellers by last name.
localSellerByFirstnamestringSearch sellers by first name.
localSellerByEmailstringSearch sellers by email address.
byTenantIdsstringFilter metrics by tenant IDs (comma-separated).
byUserIdsstringFilter metrics by user IDs (comma-separated).
byBusinessIdsstringFilter metrics by business IDs (comma-separated).

Response: 200 OK

A successful response returns a set of metrics based on the provided filters.

Example Response:

{
"metrics": [
{
"metricName": "Total Sellers",
"metricValue": 100,
"groupBy": "FARMER",
"dateRange": "2020-11-12,2022-11-15"
},
{
"metricName": "New Sellers",
"metricValue": 20,
"groupBy": "MINER",
"dateRange": "2020-11-12,2022-11-15"
}
]
}

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request GET \ 
--url /api/v1/local-sellers/metrics \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!